//
//  TRAppViewController.m
//  WeiMiLan
//
//  Created by Mac on 14-9-20.
//  Copyright (c) 2014年 Mac. All rights reserved.
//

#import "TRAppViewController.h"

@interface TRAppViewController ()

@end

@implementation TRAppViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString * adURL = [MobClick getAdURL];
    
    NSLog(@"string:%@",adURL);
    adURL =[adURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL * url=[NSURL URLWithString:adURL];
    
    
    
    
    [self.webView loadRequest:[NSURLRequest requestWithURL:url]];
    
    [self initNavigation];
}
- (void)initNavigation
{
    [self.navigationController setNavigationBarHidden:YES animated:YES];
  //  self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"main_bg"]];
    self.view.backgroundColor = [UIColor whiteColor];
    self.weChatNavigationBar=[[WeChatNavigationBar alloc] init];
    [self.view addSubview:self.weChatNavigationBar];
    self.weChatNavigationBar.titleLabel.text=@"广告";
    [self.weChatNavigationBar.rightButton setImage:nil forState:0];
    [self.weChatNavigationBar .leftButton addTarget:self action:@selector(exit)  forControlEvents:UIControlEventTouchUpInside];
    
    
}

-(void)exit
{
    
    [self.navigationController popViewControllerAnimated:YES];
}


@end
